#include<signal.h>
#include<stdio.h>
#include<unistd.h>

int main()
{
    int t = 1;
    while(1)
    {
        printf("time = %d\n",t);
        sleep(1);

        //运行5s后终止进程
        if(t == 5)
            raise(SIGINT);
        t++;
    }
    return 0;
}